IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[EventLogType]') AND type in (N'U'))
BEGIN
     DROP TABLE dbo.EventLogType
END
GO

CREATE TABLE dbo.EventLogType(
     EventLogTypeId   int         NOT NULL,
     EventLogTypeCd   varchar(5)  NOT NULL,
     EventLogTypeDesc varchar(15) NOT NULL,
     CONSTRAINT PK_EventLogType PRIMARY KEY CLUSTERED ( EventLogTypeId ASC )
)
GO

CREATE UNIQUE NONCLUSTERED INDEX [IX_EventLogType_EventLogTypeCd] ON [dbo].[EventLogType] ([EventLogTypeCd])
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Unique Identifier of a particular Event Log Type.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'EventLogType', @level2type=N'COLUMN',@level2name=N'EventLogTypeId'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Secondary Unique Identifier of a particular Event Log Type, user defined.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'EventLogType', @level2type=N'COLUMN',@level2name=N'EventLogTypeCd'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Description of Event Log Type.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'EventLogType', @level2type=N'COLUMN',@level2name=N'EventLogTypeDesc'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Event logging types.  Contains list of event log types, normally: Unknown(0), Informational(1), Warning(2), and Error(3).' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'EventLogType'
GO
